define(() => {

  const VLink = {
    template: `
    <a
      :href='href'
      @click='go'
    >
      <slot></slot>
    </a>
    `,
    props: {
      href: {
        type: String,
        required: true
      }
    },
    computed: {
    },
    methods: {
      go(e) {
        e.preventDefault();
        console.log(this.$root.curRoute, this.href);
        /**
         * 这里是子组件改变父组件值
         * 使url能被路由匹配出来
         */
        this.$root.curRoute += '/' + this.href;
        // window.history.pushState(
        //   null, Routes[this.href], this.href
        // )
      }
    }
  }

  return VLink
});